cmake_minimum_required(VERSION 3.0.2)
project(platform)

add_compile_options(-std=c++11)
MESSAGE(工作目录：${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -g -O3 -march=native")
#set(CMAKE_BUILD_TYPE Release)
MESSAGE("Build type:  " ${CMAKE_BUILD_TYPE})


#AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/ThirdPart/*/include   includeFiles)
#MESSAGE(include: ${includeFiles})

include_directories(
 ${PROJECT_SOURCE_DIR}/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/threadPool
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/Json
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/loger
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/utilsTools
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/socketDataParse
 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/worker
)

link_directories(
 ${PROJECT_SOURCE_DIR}/lib
)

file(GLOB soFiles ${PROJECT_SOURCE_DIR}/../ThirdPart/0_lib/*/*.so)
SET( soFiles ${soFiles})
MESSAGE(so: ${soFiles})
# set libs
set(LIBS 
  ${soFiles}
)


######## ##############

#通过 AUX_SOURCE_DIRECTORY 将 A1 目录名赋值给变量 A1_DIR_VAR；target_sources 
#则按照规则，添加变量 A1_DIR_VAR 目录下所有的源文件
# AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/src   srcFile)
# MESSAGE(${srcFile})
#target_sources(${target} PRIVATE ${srcFile})

add_executable(demo
  src/main.cpp
  src/platform.cpp
)
target_link_libraries(demo
  ${LIBS}
)

add_executable(${PROJECT_NAME}_test src/test.cpp)
target_link_libraries(${PROJECT_NAME}_test
  ${LIBS}
)
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


#install(FILES ${PROJECT_BINARY_DIR}/bin/Release/NTBone.dll DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)